<?php


namespace app\crm\validate;


use think\Validate;

/**
 * Class Article
 * @package app\admin\validate
 */
class Customer extends Validate
{

    /**
     * 验证规则
     * @var string[]
     */
    protected $rule = [
        'id'                 => 'require|number|gt:0',
        'shop_id'            => 'require|number|gt:0',
        'customer_name'      => 'require|max:200',
        // 'effective_entry'    => 'require|in:1,2',
    ];

    /**
     * 错误信息
     * @var string[]
     */
    protected $message = [
        'id.require'                 => '参数错误',
        'id.number'                  => '参数错误',
        'id.gt'                      => '参数错误',
        'shop_id.require'            => '请选择归属门店',
        'shop_id.number'             => '请选择归属门店',
        'shop_id.gt'                 => '请选择归属门店',
        'customer_name.require'      => '请填写客户名称',
        'customer_name.max'          => '客户名称最多200个字符',
        'repair_progress.require'    => '请选择治疗进展',
        'repair_progress.in'         => '请选择治疗进展',
        // 'effective_entry.require'    => '请选择是否有效进店',
        'effective_entry.in'         => '请选择是否有效进店'
    ];

    /**
     * 验证场景
     * @var string[]
     */
    protected $scene = [
        'create' => ['shop_id', 'customer_name', 'repair_progress', 'effective_entry'],
        'update' => ['shop_id', 'customer_name', 'repair_progress', 'effective_entry', 'id'],
    ];

}